From 0b3cd8b8316e46725a9430cfbc4bd9b16877f385 Mon Sep 17 00:00:00 2001 From: "kaf24@labyrinth.cl.cam.ac.uk" Date: Sun, 9 Feb 2003 11:48:49 +0000 Subject: [PATCH] bitkeeper revision 1.22.2.10 (3e464021ENDSDzm_b9aKHVld8d-Hqw) if_vlan.h, tg3.c, e1000_main.c, apic.c: Minor cleanups. --- xen-2.4.16/arch/i386/apic.c | 33 +++++------------------ xen-2.4.16/drivers/net/e1000/e1000_main.c | 5 +++- xen-2.4.16/drivers/net/tg3.c | 7 ++--- xen-2.4.16/include/xeno/if_vlan.h | 4 +++ 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/xen-2.4.16/arch/i386/apic.c b/xen-2.4.16/arch/i386/apic.c index 8cfe52e5d3..10b9ef03ff 100644 --- a/xen-2.4.16/arch/i386/apic.c +++ b/xen-2.4.16/arch/i386/apic.c @@ -200,35 +200,16 @@ void __init sync_Arb_IDs(void) extern void __error_in_apic_c (void); /* - * An initial setup of the virtual wire mode. + * WAS: An initial setup of the virtual wire mode. + * NOW: We don't bother doing anything. All we need at this point + * is to receive timer ticks, so that 'jiffies' is incremented. + * If we're SMP, then we can assume BIOS did setup for us. + * If we're UP, then the APIC should be disabled (it is at reset). + * If we're UP and APIC is enabled, then BIOS is clever and has + * probably done initial interrupt routing for us. */ void __init init_bsp_APIC(void) { - unsigned long l, h; - - /* - * Don't do the setup now if we have a SMP BIOS as the - * through-I/O-APIC virtual wire mode might be active. - */ - if (smp_found_config || !cpu_has_apic) - return; - - /* - * Our best bet here is to disable the APIC. This should be safe, as it - * ought to be a uniprocessor box (we tested for an SMP configuration - * already), so we shouldn't be getting interrupt messages in serial-bus - * form from an IO APIC. The APIC will be enabled again later, so don't - * worry :-) Doing the easy thing here should make boot-time more reliable. - */ - printk("Disabling local APIC during early boot sequence...\n"); - rdmsr(MSR_IA32_APICBASE, l, h); - l &= ~MSR_IA32_APICBASE_BASE; - wrmsr(MSR_IA32_APICBASE, l, h); - - /* We should now be in non-APIC mode. */ - l = cpuid_edx(1); - if ( test_bit(X86_FEATURE_APIC, &l) ) BUG(); - clear_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability); } void __init setup_local_APIC (void) diff --git a/xen-2.4.16/drivers/net/e1000/e1000_main.c b/xen-2.4.16/drivers/net/e1000/e1000_main.c index 3d4556b68e..0d3b62505a 100644 --- a/xen-2.4.16/drivers/net/e1000/e1000_main.c +++ b/xen-2.4.16/drivers/net/e1000/e1000_main.c @@ -210,10 +210,13 @@ static int __init e1000_init_module(void) { int ret; + +#if 0 /* Avoid disconcerting noise. */ printk(KERN_INFO "%s - version %s\n", e1000_driver_string, e1000_driver_version); printk(KERN_INFO "%s\n", e1000_copyright); +#endif ret = pci_module_init(&e1000_driver); // if(ret >= 0) @@ -1470,7 +1473,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) static void e1000_tx_timeout(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + //struct e1000_adapter *adapter = netdev->priv; /* Do the reset outside of interrupt context */ //schedule_task(&adapter->tx_timeout_task); XXXX Not in Xen!!! diff --git a/xen-2.4.16/drivers/net/tg3.c b/xen-2.4.16/drivers/net/tg3.c index 2f36ffbca4..060154fa2b 100644 --- a/xen-2.4.16/drivers/net/tg3.c +++ b/xen-2.4.16/drivers/net/tg3.c @@ -2000,9 +2000,9 @@ static int tg3_poll(struct net_device *netdev, int *budget) { struct tg3 *tp = netdev->priv; struct tg3_hw_status *sblk = tp->hw_status; - unsigned long flags; int done; #ifdef NAPI + unsigned long flags; spin_lock_irqsave(&tp->lock, flags); #endif if (!(tp->tg3_flags & @@ -2023,10 +2023,9 @@ static int tg3_poll(struct net_device *netdev, int *budget) done = 1; if (sblk->idx[0].rx_producer != tp->rx_rcb_ptr) { - int orig_budget = *budget; int work_done; - #ifdef NAPI + int orig_budget = *budget; if (orig_budget > netdev->quota) orig_budget = netdev->quota; @@ -2075,7 +2074,9 @@ static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct tg3 *tp = dev->priv; +#ifdef NAPI struct tg3_hw_status *sblk = tp->hw_status; +#endif unsigned long flags; spin_lock_irqsave(&tp->lock, flags); diff --git a/xen-2.4.16/include/xeno/if_vlan.h b/xen-2.4.16/include/xeno/if_vlan.h index aa9fb49890..c8c0903e52 100644 --- a/xen-2.4.16/include/xeno/if_vlan.h +++ b/xen-2.4.16/include/xeno/if_vlan.h @@ -183,7 +183,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, break; }; +#ifdef NAPI return (polling ? netif_receive_skb(skb) : netif_rx(skb)); +#else + return netif_rx(skb); +#endif } static inline int vlan_hwaccel_rx(struct sk_buff *skb, -- 2.30.2